<template>
	<view>
		<uni-steps :options="list1" ></uni-steps>
		<uni-card>
			<view class="u-demo-title">
				{{conten.first}}———全程{{conten.mileage}}公里————{{conten.end}}
			</view>
		</uni-card>
		<uni-card>
			<view>票价：{{conten.price}}元</view>
		</uni-card>
		<uni-card>
			<uni-steps :options="list"></uni-steps>
		</uni-card>
		<uni-group style="position: fixed;bottom: 0%;right: 0%;left: 0%;z-index: 99;">
			<button type="primary" @click="xia">下一步</button>
		</uni-group>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				conten:'',
				list1:[
					{title:'第一步'},
					{title:'第二步'},
					{title:'第三步'},
					{title:'第四步'}
				],
				list:[]
			}
		},
		onLoad(options) {
			this.getlun(options.id)
		},
		methods: {
			xia(){
				uni.setStorage({
					key:'ban',
					data:this.conten,
					success: (res) => {
						uni.navigateTo({
							url:'ban2'
						})
					}
				})
			},
			getlun(id){
				this.$get(this.base+'/prod-api/api/bus/line/'+id).then((res)=>{
					this.conten = res.data
					this.$get(this.base+'/prod-api/api/bus/stop/list',{
						linesId:res.data.id
					}).then((res)=>{
						this.list =[]
						res.rows.forEach((item)=>{
							this.list.push({
								title:item.name
							})
						})
						console.log(this.list)
					})
				})
			},
		}
	}
</script>

<style>

</style>
